package br.com.portalecbahia.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Match implements Serializable{

	private static final long serialVersionUID = 1L;
	private Long id;
	private String championshipName;
	private String stadimName;
	private Long stadiumId;
	private String awayTeamName;
	private String awayTeamUrlImage; 
	private String homeTeamName;
	private String awayTeamShortName;
	private String homeTeamShortName;
	private String homeTeamUrlImage;
	private Date date;
	private Date dateUTC;
	private Integer homeGoal;
	private Integer awayGoal;
	private Boolean finished;
	private Boolean live;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getChampionshipName() {
		return championshipName;
	}
	public void setChampionshipName(String championshipName) {
		this.championshipName = championshipName;
	}
	public String getStadimName() {
		return stadimName;
	}
	public void setStadimName(String stadimName) {
		this.stadimName = stadimName;
	}
	public String getAwayTeamName() {
		return awayTeamName;
	}
	public void setAwayTeamName(String awayTeamName) {
		this.awayTeamName = awayTeamName;
	}
	public String getAwayTeamUrlImage() {
		return awayTeamUrlImage;
	}
	public void setAwayTeamUrlImage(String awayTeamUrlImage) {
		this.awayTeamUrlImage = awayTeamUrlImage;
	}
	public String getHomeTeamName() {
		return homeTeamName;
	}
	public void setHomeTeamName(String homeTeamName) {
		this.homeTeamName = homeTeamName;
	}
	public String getHomeTeamUrlImage() {
		return homeTeamUrlImage;
	}
	public void setHomeTeamUrlImage(String homeTeamUrlImage) {
		this.homeTeamUrlImage = homeTeamUrlImage;
	}
	
	public Integer getDayDate(){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.DAY_OF_MONTH);
	}
	
	public Integer getMonthDate(){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.MONDAY)+1;
	}
	
	public Integer getYearDate(){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.YEAR);
	}

	public String getHourDate(){
		   // assigns calendar to given date 
        SimpleDateFormat obDateFormat = new SimpleDateFormat("HH:mm");
        Calendar time = Calendar.getInstance();
        time.setTime(date);
       
		String result = obDateFormat.format(time.getTime())+"";
		
		if(result.equals("00:00")){
			return "   :   ";
		}else{
			return result;
		}
	}
	
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getDateUTC() {
		return dateUTC;
	}
	public void setDateUTC(Date dateUTC) {
		this.dateUTC = dateUTC;
	}
	public Integer getHomeGoal() {
		return homeGoal;
	}
	public void setHomeGoal(Integer homeGoal) {
		this.homeGoal = homeGoal;
	}
	public Integer getAwayGoal() {
		return awayGoal;
	}
	public void setAwayGoal(Integer awayGoal) {
		this.awayGoal = awayGoal;
	}
	public Boolean getFinished() {
		return finished;
	}
	public void setFinished(Boolean finished) {
		this.finished = finished;
	}
	public String getAwayTeamShortName() {
		return awayTeamShortName;
	}
	public void setAwayTeamShortName(String awayTeamShortName) {
		this.awayTeamShortName = awayTeamShortName;
	}
	public String getHomeTeamShortName() {
		return homeTeamShortName;
	}
	public void setHomeTeamShortName(String homeTeamShortName) {
		this.homeTeamShortName = homeTeamShortName;
	}
	public Long getStadiumId() {
		return stadiumId;
	}
	public void setStadiumId(Long stadiumId) {
		this.stadiumId = stadiumId;
	}
	public Boolean getLive() {
		return live;
	}
	public void setLive(Boolean live) {
		this.live = live;
	}
	
	
}
